//
//  HomeViewController.h
//  MoneyLog
//
//  Created by wicresoft on 5/16/11.
//  Copyright 2011 wicresoft. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Database.h"

enum {
    kDaySection = 0,
    kMonthSection,
    kYearSection,
};

@interface  StatResult:  NSObject  {
    
@public
    double incomeValue;
    double expenseValue;
    double totalValue;
    
    int    incomeCount;
    int    expenseCount;
    int    totalCount;
}

@property (assign) double incomeValue;
@property (assign) double expenseValue;
@property (assign) double totalValue;
@property (assign) int    incomeCount;
@property (assign) int    expenseCount;
@property (assign) int    totalCount;

-(void)resetData;

@end 

@interface HomeViewController : UIViewController<UITableViewDelegate,UITableViewDataSource> {
    UITableView     *_tableView;
    
    NSArray         *dataSourceArray;
}

@property (nonatomic,retain) IBOutlet UITableView   *_tableView;
@property (nonatomic,retain) NSArray                *dataSourceArray;

- (NSString *)titleForSection:(NSInteger)section;
- (id)viewForTableRow:(NSIndexPath *)indexPath;
- (NSString *)textForTableRow:(NSIndexPath *)indexPath;

-(StatResult *)statRecord:(NSString *)whereString;

@end



